package com.briup.MR.workflow;

import com.briup.MR.Combiner.SumValue;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

/**
 *
 */
public class SecondAvgTempMR {
    static class SecondAvgTempMRMapper extends Mapper<Text, SumValue,Text, DoubleWritable>{
        @Override
        protected void map(Text key, SumValue value, Context context) throws IOException, InterruptedException {
            context.write(key,
                    new DoubleWritable(
                            value.getTemp()/value.getNum()));
        }
    }
}
